package org.jeecg.modules.procurement.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.procurement.entity.BussMaterialProcurementDetail;
import org.jeecg.modules.procurement.vo.BussMaterialProcurementDetailVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: 原料采购订单明细
 * @Author: jeecg-boot
 * @Date:   2024-06-06
 * @Version: V1.0
 */
public interface BussMaterialProcurementDetailMapper extends BaseMapper<BussMaterialProcurementDetail> {

  /**
   * 通过主表id删除子表数据
   *
   * @param mainId 主表id
   * @return boolean
   */
	public boolean deleteByMainId(@Param("mainId") String mainId);

  /**
   * 通过主表id查询子表数据
   *
   * @param mainId 主表id
   * @return List<BussMaterialProcurementDetail>
   */
	public List<BussMaterialProcurementDetailVo> selectByMainId(@Param("mainId") String mainId);

    public IPage<BussMaterialProcurementDetailVo> pageList(IPage<BussMaterialProcurementDetailVo> page, @Param(Constants.WRAPPER) QueryWrapper<BussMaterialProcurementDetailVo> queryWrapper);

    /**
     * 获取已生成的采购总数量
     * @param procurementPlanId
     * @return
     */
    BigDecimal sumOrder(@Param("procurementPlanId") String procurementPlanId);




}
